﻿using System.Collections.Generic;
using System.Threading;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using Color = System.Windows.Media.Color;
using Point = System.Windows.Point;

namespace weBoard
{
    /// <summary>
    /// weBoard:mainWnd consts and variables below
    /// </summary>
    public partial class mainWnd
    {
        #region Public properties and variables

        public drawingMachine Drawbot;              //does almost all

        #endregion Public properties and variables

        #region Private properties and variables
        private weBoardClient _client;              //does network protocol

        private Point _position;                    //where is mouse?

        private List<Point> _pts;                   //coords for objects;

        private weBoardAction _a;                   //act for internal needs

        private class modeMediaData                 //common struct with all necessary for chosen mode
        {
            public Cursor Cursor;                   //cursor for canvas
            public BitmapImage ActiveBmp;           //mode is selected
            public BitmapImage InactiveBmp;         //mode is not selected
        }

        private List<modeMediaData> _modeMedia;     //Icons and cursors for drawing modes

        private bool _imgsPrepared;                 //images for buttons were created
        private bool _canMove;                      //can we move or not
        private bool _creation;                     //is object just created before?
        private bool _isBackColor;                  //background or foreground color
        private bool _sizeSelStarted;               //we are selecting a size
        private bool _toolSelStarted;               //we are selecting a tool
        private bool _isPalVisible;                 //is our palette image visible?
        private bool _palSelection;                 //we are selecting color
        private bool _discovering;                  //we are discovering server

        private Thread _discThread;                 //thread for gui non-blocking purposes

        private int _firstMove;                     //is it first or second mousemove event at created obj?

        private ContextMenu _canvasMenu;            //our context menu for drawings

        private const int NSizes = 5;               //we have 5 sizes now

        private Color _currentColor;                //current fore color
        private Color _backgroundColor;             //current back color
        private Color _selectionColor;              //current color of selection bound
        private Color _tmpPalColor;                 //current color at mouse point of palette

        private List<byte> _sizes;                  //possible sizes of object
        private double _currentSize;                //currently selected size value
        private int _szIdx;                         //index of currently selected size

        private eCurSel _nowSelectedMode;           //currently selected mode
        private eCurSel _nowSelectedTool;           //currently selected drawing tool
        private eCurSel _lastMode;                  //mode that was before some actions

        #endregion Private properties and variables
    }
}